<?php
//
///*
//|--------------------------------------------------------------------------
//| Web Routes
//|--------------------------------------------------------------------------
//|
//| Here is where you can register web routes for your application. These
//| routes are loaded by the RouteServiceProvider within a group which
//| contains the "web" middleware group. Now create something great!
//|
//*/
////注册 auth 中间件
Auth::routes();

//退出登录 自动提交测试 s
Route::any('loginout',function (){
    Auth::logout();
    return redirect('/');
});

Route::get('nonPublicVersion/gamedown','NonPublicVersion\GameList@down');
//支付成功回调地址
Route::any('payCallback','NonPublicVersion\Pay@index');
Route::get('package/{id}','Api\Package@download');
Route::get('nonPublicVersion/gamePackage/{id}','NonPublicVersion\PackageList@show');
Route::any('jump','Home@jump');
//非公版SDK后台
//Route::group(['middleware'=>'login','prefix' => 'nonPublicVersion','namespace'=>'NonPublicVersion'],function (){
Route::group(['prefix' => 'nonPublicVersion','namespace'=>'NonPublicVersion','middleware'=>'auth'],function (){
    //渠道
    Route::resource('channel','Channel');
    Route::post('channel/getChild','Channel@child');
    Route::post('cooperate','Channel@cooperate');
    //获取游戏供应商
    Route::get('getSupplier','GameList@getSupplier');
    Route::resource('game','GameList');
    Route::any('uploadchunk','GameList@uploadchunk');
    Route::post('game/uploadFile','GameList@uploadFile');
    //游戏配置列表
    Route::get('gameConfig/getGames','GameConfig@getGames');
    Route::any('checkGame','GameConfig@checkGame');
    Route::resource('gameConfig','GameConfig');

    //支付设置
    Route::resource('payConfig','PayConfig');

    //打包列表
    Route::resource('gamePackage','PackageList');

    //游戏打包
    Route::get('gamePackage/{id}/{game_name}/{supplier_name}/{platform}','PackageList@create');
    //获取当前渠道对就的父渠道
    Route::get('getChannel/{id}','PackageList@getChannel');
    Route::get('getChannel','GameConfig@getChannel');
    Route::get('order','Order@index');
});
//使用 auth 中间件
Route::group(['middleware'=>'auth'], function () {
//Route::group([],function () {
    Route::get('/','Home@index');
    Route::get('home','Home@index');
    Route::get('welcome','Home@welcome');
    Route::get('menu','Menu@index');
    Route::get('menuAdd','Menu@menuAdd');
    Route::post('menu','Menu@store');
});